package com.yujn.controller;

import cn.hutool.json.JSONUtil;
import com.yujn.bean.ValidBean;
import com.yujn.bean.param.UpdateValid;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

@RestController
@RequestMapping("/valid")
public class ValidController {

    @PostMapping("/update")
    public String updateValid(@RequestBody @Valid UpdateValid update){
        return JSONUtil.toJsonStr(update);
    }
}
